import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 接待记录信息 */
export interface ReportReception {
          id: number; // 编号
          processInstanceId?: string; // 实例ID
          receptionTitle: string; // 接待名称
          schoolCode: string; // 园区
          deptId: number; // 部门ID
          receptionType: string; // 接待级别
          deptName: string; // 主办部门
          sponsorUserName: string; // 主办方联系人
          sponsorPhone: string; // 主办方联系电话
          receptionTime: string | Dayjs; // 接待日期
          receptionAddress: string; // 接待地点
          receptionPeopleCount: number; // 接待人数
          receptionContent: string; // 接待内容
          receptionUserName: string; // 对方联系人
          receptionPhone: string; // 对方联系方式
          receptionUnit: string; // 对方单位
          receptionPost: string; // 对方职务
          sort?: number; // 排序
          status?: number; // 状态
  }

// 接待记录 API
export const ReportReceptionApi = {
  // 查询接待记录分页
  getReportReceptionPage: async (params: any) => {
    return await request.get({ url: `/school/report-reception/page`, params })
  },

  // 查询接待记录详情
  getReportReception: async (id: number) => {
    return await request.get({ url: `/school/report-reception/get?id=` + id })
  },

  // 新增接待记录
  createReportReception: async (data: ReportReception) => {
    return await request.post({ url: `/school/report-reception/create`, data })
  },

  // 修改接待记录
  updateReportReception: async (data: ReportReception) => {
    return await request.put({ url: `/school/report-reception/update`, data })
  },

  // 删除接待记录
  deleteReportReception: async (id: number) => {
    return await request.delete({ url: `/school/report-reception/delete?id=` + id })
  },

  /** 批量删除接待记录 */
  deleteReportReceptionList: async (ids: number[]) => {
    return await request.delete({ url: `/school/report-reception/delete-list?ids=${ids.join(',')}` })
  },

  // 导出接待记录 Excel
  exportReportReception: async (params) => {
    return await request.download({ url: `/school/report-reception/export-excel`, params })
  },
}